package com.jeff

class Book {
	String title
	String author
	//the following 2 fields already specified in the src/templates/scaffolding/{edit | create}.gsp, governed in excludeProps,
	//which means these 2 fields will not be available for use to change, the value will be assigned at server side before update db.
	Date dateCreated
	Date lastUpdated
	
    static constraints = {
		title(blank:false)
		author(blank:false)
    }
	
	/**
	 *  name these 2 fields as in here, the following interceptor definition is implicitly implemented by default
	def beforeInsert = {
		dateCreated = new Date()
	}
	
	def beforeUpdate = {
		lastUpdated = new Date()
	}
	*/
}
